<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://code.jquery.com/jquery-3.7.1.js"
            integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
</head>
<body>
<input type="button" onclick="getData()" value="get">

<input type="button" onclick="getPutData()" value="put">
<script>
    function getData(){
        $.get('http://localhost:8080/hello',function (msg){
            alert(msg);
        })
    }

    function getPutData(){
        $.ajax({
            url:'http://localhost:8080/hello2',
            type:'put',
            success:function (msg) {
                alert(msg)
            }
        })
    }
</script>
</body>
</html>